<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<title>FLDCMS后台管理系统</title>
<meta name="keywords" content="FLDCMS，FLDCMS后台管理系统">
<meta name="description" content="FLDCMS，是一款由FLD开发的轻量级扁平化网站后台模板，适合中小型CMS后台系统。">
{include file="public/header" /}
<style>
	img[nc_type="flex"]{cursor:pointer;}
</style>
</head>
<body>
<article class="page-container">
	<form action="{:url('article/add')}" method="post" enctype="multipart/form-data" class="form form-horizontal" id="form-add">
		<input type="hidden" name="form_submit" value="ok"/>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>所属分类：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="select-box radius">
					<select name="class_id" class="select valid">
						{foreach name="cate_list" item="cvo"}
						<option value="{$cvo.id}">{$cvo.cate_name}</option>
						{/foreach}
					</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="请填写文章标题" id="article_title" name="article_title">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>作者：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="风凌度" placeholder="请填写作者" id="article_author" name="article_author">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">关键词：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" id="article_keywords" name="article_keywords" placeholder="多个关键词用顿号分隔，若关键词为空，则默认获取文章关键字">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">描述：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" id="article_description" name="article_description" placeholder="请填写描述，若描述为空，则默认获取文章前200个文字">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">标签：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div id="hui-tags"></div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">是否显示：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div class="skin-minimal">
				  <div class="radio-box">
				    <input type="radio" id="radio-1" name="is_show" value="1" checked>
				    <label for="radio-1">是</label>
				  </div>
				  <div class="radio-box">
				    <input type="radio" id="radio-2" name="is_show" value="0">
				    <label for="radio-2">否</label>
				  </div>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">是否置顶：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div class="skin-minimal">
				  <div class="radio-box">
				    <input type="radio" id="radio-1" name="is_top" value="1" checked>
				    <label for="radio-1">是</label>
				  </div>
				  <div class="radio-box">
				    <input type="radio" id="radio-2" name="is_top" value="0">
				    <label for="radio-2">否</label>
				  </div>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章图片：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="btn-upload form-group">
				  <input class="input-text upload-url radius" type="text" name="uploadfile" id="uploadfile" readonly>
				  <a href="javascript:void();" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
				  <input type="file" name="article_img" class="input-file" value="">
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">内容：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<script id="inputContent" name="article_content" type="text/plain"></script>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button class="btn btn-secondary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
			</div>
		</div>
	</form>
</article>
{include file="public/footer" /}
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#hui-tags").Huitags(
		{
			name : 'tags',
			value : '',
			maxlength : 20,
			number : 5,
			tagsDefault : [
				{foreach name="tag_list" item="tvo"}"{$tvo.tag_name}",{/foreach}
			],
		}
	);
	var ue = UE.getEditor('inputContent',{initialFrameHeight:400});
	$("#form-add").validate({
		rules:{
			article_title:{
				required:true,
				maxlength:100
			},
			article_author:{
				required:true,
				maxlength:20
			},
		},
		messages: {
			article_title:{
				required:'文章标题不能为空',
				maxlength:'文章标题不能大于100个字符'
			},
			article_author:{
				required:'作者不能为空',
				maxlength:'作者不能大于20个字符'
			},
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
                dataType:"json",
                success:function(data){
                   if(data.error == 0){
                	   	layer.msg(data.msg, {icon: 1,time: 1000}, function(){
                	   		var index = parent.layer.getFrameIndex(window.name);
                			parent.location.reload();
               				parent.layer.close(index);
                		});
                   }else{
                	   layer.msg(data.msg,{icon:2,time:1000});
                   }
                }
            });
		}
	});
});
</script>
<script type="text/javascript" src="__JS__/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="__JS__/ueditor/1.4.3/ueditor.all.min.js"></script>
</body>
</html>